﻿using Architecture.Api.Application.Commands.SlaughterCorporationCommand;
using Architecture.Domain.Services.Interface;
using Architecture.Domain.TraceabilityManage;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.SlaughterCorporationHandler
{
    public class CorporationQueryCommandHandler : IRequestHandler<SlaughterCorporationQueryInfoCommand, Corporation>
    {
        private readonly ISlaughterService _slaughterService;

        public CorporationQueryCommandHandler(ISlaughterService slaughterService)
        {
            _slaughterService = slaughterService;
        }

        public Task<Corporation> Handle(SlaughterCorporationQueryInfoCommand request, CancellationToken cancellationToken)
        {
            return _slaughterService.GetCorporationInfo(request.productionLot, request.slaughteringCompanyId);
        }
    }


}
